/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package cz.ctu.android.DriveCommunicator.adapters;

import android.content.ContentResolver;
import android.content.Context;
import android.database.Cursor;
import android.net.Uri;
import android.widget.ArrayAdapter;
import java.util.List;

/**
 *
 * Adapter for loading thread conversations from inner database
 * 
 * 
 * @author karlos
 */
public class ConversationAdapter<T> extends ArrayAdapter<T> {
    
    protected ContentResolver contentResolver;
    
    public ConversationAdapter(Context context, int textViewResourceId) {
        super(context, textViewResourceId);
    }
    
    public ConversationAdapter(Context context, int resource, int textViewResourceId) {
        super(context, resource, textViewResourceId);
    }
    
    public ConversationAdapter(Context context, int textViewResourceId, T[] objects) {
        super(context, textViewResourceId, objects);
    }
    
    public ConversationAdapter(Context context, int resource, int textViewResourceId, T[] objects) {
        super(context, resource, textViewResourceId, objects);
    }

    public ConversationAdapter(Context context, int textViewResourceId, List<T> objects) {
        super(context, textViewResourceId, objects);
    }

    public ConversationAdapter(Context context, int resource, int textViewResourceId, List<T> objects) {
        super(context, resource, textViewResourceId, objects);
    }
    
    
    protected void loadConversations() {
        final String[] projection = new String[]{"*"};
        Uri uri = Uri.parse("content://mms-sms/conversations/");
        Cursor query = contentResolver.query(uri, projection, null, null, null);

        // TODO write logic for get content...
        String[] values = query.getColumnNames();
        String columns = null;

        for (String i : query.getColumnNames()) {
            columns += "|" + i;
        }

    }
    
}
